package com.itheima.controller;

import com.itheima.pojo.ClazzOption;
import com.itheima.pojo.JobOption;
import com.itheima.service.ReportService;
import com.itheima.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 报表统计
 */
@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result empJobData(){
        JobOption jobOption=reportService.empJobData();
        return Result.success(jobOption);
    }

    /**
     * 性别统计
     * @return
     */
    @GetMapping("/empGenderData")
    public Result empGenderData(){
        List<Map<String, Object>> list=reportService.empGenderData();
        return Result.success(list);
    }

    @GetMapping("/studentDegreeData")
    public Result studentDegreeData(){
        List<Map<String, Object>> list=reportService.studentDegreeData();
        return Result.success(list);
    }


    @GetMapping("/studentCountData")
    public Result studentCountData(){
        ClazzOption map=reportService.studentCountData();
        return Result.success(map);
    }
}
